#include "Window.h"

Window::Window(int x, int y, int width, int height) : x(x), y(y), width(width), height(height), visible(true) {

}

Window::~Window() {

}

int Window::getX() const {
	return x;
}

int Window::getY() const {
	return y;
}

int Window::getWidth() const {
	return width;
}

int Window::getHeight() const {
	return height;
}

bool Window::isVisible() const {
	return visible;
}

void Window::setLocation(int newX, int newY) {
	x = newX;
	y = newY;
}

void Window::setSize(int newWidth, int newHeight) {
	width = newWidth;
	height = newHeight;
}

void Window::setVisible(bool newVisible) {
	visible = newVisible;
}

void Window::draw() {
	if(!visible) return;
	glPushMatrix(); {
		glTranslatef(x, y, 0);
		glColor3ub(255, 255, 255);
		glBegin(GL_QUADS); {
			glVertex2i(0, 0);
			glVertex2i(width, 0);
			glVertex2i(width, height);
			glVertex2i(0, height);
		} glEnd();
		drawContent();
	} glPopMatrix();
}
